This is the indirect relative particle, past tense. When followed by a lenitable consonant it normally lenites.
It is not the same word as the simple preposition ar, meaning on, although they are homophones.